<!--[if ie 6]>
      <style type="text/css">
      div#content div.buttonMinibox{width:200px;display:inline;float:none;overflow: hidden;}
      div#content div.buttonBox{width:600px;height:30px;}
      </style>
<![endif]-->

<?php
	echo $accessibility->whereIAm($pageTitle,array(array('title'=>'Fórum','link'=>'/forums'),array('title'=>'Discussão')));
	echo $this->renderElement('message');

	echo "<h2 id='contentTitle'>".$forum['Forum']['title']."</h2>";
	echo "<p>".$forum['Forum']['description']."</p>";
	echo "<div id='view'>";
	echo "<table>";

	$zebrado = true;
	if (isset($posts) && is_array($posts) && (!empty($posts))) {

		foreach ($posts as $post) {
			$zebrado = !$zebrado;
			echo "<tr><td class='noborder'>";
			//Mostrando Post
			$box->criaPost($post,$zebrado);
			echo "</td></tr>";
		}

	}
	echo "</table>";
	echo "<br><br>";

	/* Botoes - Inicio */
	$entity = 'forums';
	$model = 'Forum';
	$label = 'discussão';
	$label_plural = 'discussões';

	echo "<div class='buttonBox'>";
	echo "<div class='buttonMinibox'>";
	$addButton = "<span class=\"buttonAdd\">Responder</span>";
	echo html_entity_decode($html->link($addButton, "/posts/add/".$forum['Forum']['id'],array('class'=>'button')));
	echo "</div>";

	echo "<div class='buttonMinibox'>";
	$listButton = "<span class=\"buttonList\">Listar ".$label_plural."</span>";
	echo html_entity_decode($html->link($listButton, '/'.$entity.'/',array('class'=>'button')));
	echo "</div>";
	echo "<div class='buttonMinibox'>";
	if ($othAuth->hasPermission($entity.'/delete/')) {
		$deleteButton = "<span class=\"buttonDelete\">Apagar ".$label."</span>";
		echo html_entity_decode($html->link($deleteButton,'/'.$entity.'/delete/'.$forum[$model]['id'], array('class'=>'button'), 'Confirma a exclusão deste item?'));
	}
	echo "</div>";
	echo "</div>";
	/* Botoes - Fim */


	echo "</div>";
?>